<template>
  <div>
    <span>爱好: </span>
    <!-- 复选框(单独记忆) -重点(张口就来)
v-model的vue变量的类型非数组-关联的是标签的checked(选中状态)属性
v-model的vue变量的类型数组关键的是标签的value属性 -->
    <input type="checkbox" v-model="hobby" value="科幻" /><span>科幻</span>
    <input type="checkbox" v-model="hobby" value="喜剧" /><span>喜剧</span>
    <input type="checkbox" v-model="hobby" value="动漫" /><span>动漫</span>
    <input type="checkbox" v-model="hobby" value="冒险" /><span>冒险</span>
    <input type="checkbox" v-model="hobby" value="激情" /><span>激情</span>
    <input type="checkbox" v-model="hobby" value="军事" /><span>军事</span>
    <input type="checkbox" v-model="hobby" value="娱乐" /><span>娱乐</span>
    <input type="checkbox" v-model="hobby" value="奇谈" /><span>奇谈</span>
    <ul>
      <li v-for="(val, index) in hobby" :key="index">
        {{ val }}
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      hobby: [],
    };
  },
};
</script>

<style>
</style>>